/**
 * 
 */
package com.yst.metho.web.application.utils;

import java.util.Comparator;

/**
 * @author perso
 * 
 */
public abstract class AbstractSuiviComparator implements Comparator
{
	/**
	 * Refeence of the column to sort.
	 */
	private int column;

	/**
	 * Sort order
	 */
	private boolean ascending = true;

	/**
	 * @return the column
	 */
	protected int getColumn()
	{
		return column;
	}

	/**
	 * @param aColumn
	 *            the column to set
	 */
	protected void setColumn(int aColumn)
	{
		if (aColumn != column)
		{
			this.column = aColumn;
		}
		else
		{
			ascending = !ascending;
		}
	}

	/**
	 * @return the ascending
	 */
	protected boolean isAscending()
	{
		return ascending;
	}

	/**
	 * @param ascending
	 *            the ascending to set
	 */
	protected void setAscending(boolean ascending)
	{
		this.ascending = ascending;
	}

}
